Optimal. Leaf size=57 \[ \frac{(4 a+b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac{1}{8} x (4 a+b)-\frac{b \sin (e+f x) \cos ^3(e+f x)}{4 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0444805, antiderivative size = 57, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3191, 385, 199, 203} \[ \frac{(4 a+b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac{1}{8} x (4 a+b)-\frac{b \sin (e+f x) \cos ^3(e+f x)}{4 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3191
Rule 385
Rule 199
Rule 203
Rubi steps
\begin{align*} \int \cos ^2(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{b \cos ^3(e+f x) \sin (e+f x)}{4 f}+\frac{(4 a+b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=\frac{(4 a+b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac{b \cos ^3(e+f x) \sin (e+f x)}{4 f}+\frac{(4 a+b) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=\frac{1}{8} (4 a+b) x+\frac{(4 a+b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac{b \cos ^3(e+f x) \sin (e+f x)}{4 f}\\ \end{align*}
Mathematica [A] time = 0.0799996, size = 46, normalized size = 0.81 \[ \frac{4 (4 a e+4 a f x+b f x)+8 a \sin (2 (e+f x))-b \sin (4 (e+f x))}{32 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 70, normalized size = 1.2 \begin{align*}{\frac{1}{f} \left ( b \left ( -{\frac{\sin \left ( fx+e \right ) \left ( \cos \left ( fx+e \right ) \right ) ^{3}}{4}}+{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{8}}+{\frac{fx}{8}}+{\frac{e}{8}} \right ) +a \left ({\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.49416, size = 93, normalized size = 1.63 \begin{align*} \frac{{\left (f x + e\right )}{\left (4 \, a + b\right )} + \frac{{\left (4 \, a + b\right )} \tan \left (f x + e\right )^{3} +{\left (4 \, a - b\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.89235, size = 113, normalized size = 1.98 \begin{align*} \frac{{\left (4 \, a + b\right )} f x -{\left (2 \, b \cos \left (f x + e\right )^{3} -{\left (4 \, a + b\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.83485, size = 150, normalized size = 2.63 \begin{align*} \begin{cases} \frac{a x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{a x \cos ^{2}{\left (e + f x \right )}}{2} + \frac{a \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} + \frac{b x \sin ^{4}{\left (e + f x \right )}}{8} + \frac{b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac{b x \cos ^{4}{\left (e + f x \right )}}{8} + \frac{b \sin ^{3}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{8 f} - \frac{b \sin{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} & \text{for}\: f \neq 0 \\x \left (a + b \sin ^{2}{\left (e \right )}\right ) \cos ^{2}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12607, size = 55, normalized size = 0.96 \begin{align*} \frac{1}{8} \,{\left (4 \, a + b\right )} x - \frac{b \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac{a \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]